
	<div class="control-group row">
	
			<div class="navbar navbar-inverse navbar-fixed-top bs-docs-nav">
			  <ul class="breadcrumb">
				<li><a href="#">分类管理</a> <span class="divider">></span></li>
				<li class="active">添加分类</li>
			  </ul>
			</div>
<?php
	echo "<p>". form_error('category_name')."</p>";
	$attrbutes = array(
		'class' => 'form-horizontal',
		'id' => 'form_add'
	);
	echo form_open('category/add',$attrbutes);
?>
	 <div class="control-group">
		 <label for='category_name' class="control-label"><s>*</s>分类名</label>
		  <div class="controls">
					<input type="text" value="<?php echo set_value('category_name');?>" name="category_name" data-rules="{required:true}"/>
		  </div>
	</div>

	<div class="control-group">
		 <label for='parent_id' class="control-label"><s>*</s>父级分类</label>
		  <div class="controls">
		  <select name='parent_id'>
				<option value="0">作为顶级分类</option>
				<?php
					$cates = $this->category_model->getAllCategory2();
					foreach($cates as $item){
						echo "<option value='".$item['category_id']."'>";
						echo $item['category_name'];
						echo "</option>";
						if(isset($item['child'])){
							$this->category_model->getTree2($item['child'],0,0);
						}
					}
				?>
			</select>
		  </div>
	</div>
	
	
	 <div class="control-group">
		 <label for='ordernum' class="control-label"><s>*</s>排列顺序</label>
		  <div class="controls">
					<input type="text" value="<?php echo set_value('ordernum');?>" name="ordernum" data-rules="{required:true}"/>
		  </div>
	</div>
	
			
		<div class="actions-bar  centered">
			<input type="submit" class='button button-primary' checked="checked" value="确认添加"/>
			<input type="reset" class='button' checked="checked" value="重置"/>
		</div>
	
<?php
	
	echo form_close();
?>
	</div>

<script type='text/javascript'>

var Form = BUI.Form;
new Form.Form({
	srcNode:'#form_add'
}).render();


</script>

